<?php

class RoomFeature extends CActiveRecord
{
	public function tableName()
	{
		return lfirst(__CLASS__);
	}
	
	public static function model($className = __CLASS__)
    {
    	return parent::model(lfirst(__CLASS__));
    }
    
	public function criteria($sort = 'title', $order = 'asc', $start = false, $limit = false)
	{
    	$params = array(
    		'order'  => $sort . ' ' . $order
    	);
    	
    	if ($start !== false) {
    		$params['offset'] = intval($start);
    	}
    	
    	if ($limit !== false) {
    		$params['limit'] = intval($limit);
    	}
		
		$this->getDbCriteria()->mergeWith($params);
    	
    	return $this;
	}
}